#include "Master.h"
#include "Widget.h"
#include "DataManager/SqlEditDialog.h"

Master *Master::m_master=NULL;

Master::Master()
{
    this->m_wigdet=NULL;
}

void Master::setWidget(Widget *widget)
{
    this->m_wigdet=widget;
}

void Master::setDate(Date *date)
{
    this->m_date=date;
}

Date *Master::getDate()
{
    return this->m_date;
}

SqlEditDialog *Master::getDataManager()
{
    return SqlEditDialog::getInstance();
}

Master *Master::getMaster()
{
    if(NULL==m_master)
    {
        m_master=new Master();
    }
    return m_master;
}

Master::~Master()
{
    SqlEditDialog::getInstance()->deleteInstance();
}

Widget *Master::getWidget()
{
    return this->m_wigdet;
}
